import request from '@/utils/request'

export function stockDaily (stockCode) {
  return request({
    url: '/stockDaily',
    method: 'post',
    data: {
      stockCode
    }
  })
}

export function instantStockIndex (stockCode) {
  return request({
    url: '/instantStockIndex',
    method: 'post',
    data: {
      stockCode
    }
  })
}

export function instantStock (stockCode) {
  return request({
    url: '/instantStock',
    method: 'post',
    data: {
      stockCode
    }
  })
}

export function stockRank (pageIndex) {
  return request({
    baseURL: 'https://api.doctorxiong.club/v1/stock',
    url: 'rank',
    method: 'post',
    headers: {
      token: 'NKA5xnaeRJ'
    },
    data: {
      sort: 'changePercent',
      node: 'a',
      pageSize: 20,
      asc: 0,
      pageIndex
    }
  })
}
